function VPRDisc()
	if not IsAddOnLoaded("PQInterface") then
		if not VSIWarning then
			VAS_WriteToChat("\124cFFFF55FFWarning: only works with VSI addon!")
			VSIWarning = true
		end
		return true
	end

	if not PQI_General_Disc_Priest_GUI_Loaded then 	
		local config = {
			name	= 'General Disc Priest',
			author	= 'Vachiusa',
			abilities = {
				-- General --
				{	name = "Auto Open PQI Options",
					tooltip = "Auto Opens PQI Options for you, will only happen once per login.",
					enable = true,
				},
				{	name = "54 Events",
					tooltip = "Enables the use of 5.4 boss specific mechanics",
					enable = true,
				},				
				{	name = "53 Events",
					tooltip = "Enables the use of 5.3 boss specific mechanics",
					enable = false,
				},
				{ 	name = "4x Events",
					enable = false,
					tooltip = "Enables the use of 4.x boss specific mechanics",
				},
				{ 	name = "Special Events",
					enable = false,
					tooltip = "Enables the use of special events mechanics (Providing Ground...)",
				},	
				{ 	name = "Auto Event Dispel",
					enable = true,
					tooltip = "Enables the use of dispel on special events mechanics",
				},								
				{ 	name = "Queue Sys",
					enable = true,
					tooltip = "Enables the use of auto dispel for Queue System",
				},						
				{ 	name = "Auto Target",
					enable = true,
					tooltip = "If you dont have a target it will target your focus target",
				},
				{ 	name = "Mind bender",	
					enable = true,
					tooltip = "Enables the use of Mind bender",
					widget = { type = 'numBox',
						value = 80,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Mind bender at",
					},
				},
				{ 	name = "Solace Insanity",
					enable = true,
					tooltip = "Enables the use of Solace Insanity",
					widget = { type = 'numBox',
						value = 100,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Solace Insanity at",
					},
				},
				{ 	name = "DPS",
					enable = true,
					tooltip = "Enables DPS",
					widget = { type = 'numBox',
						value = 71,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of minimum raid members HP to DPS at",
					},
				},
				{ 	name = "Purify",
					enable = true,
					tooltip = "Enables the use of Purify",
					widget = { type = 'numBox',
						value = 50,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Purify at",
					},
				},
				{ 	name = "Fade",
					enable = true,
					tooltip = "Will use Fade when you get aggro",
				},
				{ 	name = "Inner",
					enable = true,
					tooltip = "Auto switch Inner Will and Inner Fire",
				},				
				{ 	name = "PowerWord Shield Moving",
					enable = true,
					tooltip = "Will use PowerWord:Shield to speed up when you are moving - Body and Soul talent",
				},								
				{ 	name = "Racials",
					enable = true,
					tooltip = "Enables the use of Racials",
				},								
				{ 	name = "Target Heal",
					enable = false,
					tooltip = "Enables the use of Target Heal priority",
				},											
				{ 	name = "Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of Mouseover Heal priority",
				},				
				{ 	name = "NPC Mouseover Heal",
					enable = false,
					tooltip = "Enables the use of NPC Mouseover Heal priority",
				},	
				{ 	name = "Pet Heal",
					enable = true,
					tooltip = "Enables the use of Pet Heal",
				},			
				{ 	name = "Stop Casting",
					enable = true,
					tooltip = "Enables the use of Stop Casting",
				},												
				{ 	name = "V debug",
					enable = false,
					tooltip = "Enables the use of Vachiusa debug",
				},					
			},
			hotkeys = {
			},
		}
		PQI_General_Disc_Priest_GUI_Loaded = PQI:AddRotation(config)
	end		

	if not PQI_CD_Disc_Priest_GUI_Loaded then 
		local config = {
			name	= 'CD Disc Priest',
			author	= 'Vachiusa',
			abilities = {									
				-- CD's --
				{ 	name = "Prayer Of Healing",
					enable = true,
					tooltip = "Enables the use of Prayer Of Healing",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Prayer Of Healing at",
					},
				},
				{ 	name = "Prayer Of Healing Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 2,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Prayer Of Healing at",
					},
				},
				{ 	name = "Cascade",
					enable = true,
					tooltip = "Enables the use of Cascade",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Cascade at",
					},
				},
				{ 	name = "Cascade Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Cascade at",
					},
				},
				{ 	name = "Halo",
					enable = true,
					tooltip = "Enables the use of Halo",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Halo at",
					},
				},
				{ 	name = "Halo Limit",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Halo at",
					},
				},				
				{ 	name = "Divine Star",
					enable = false,
					tooltip = "Enables the use of Divine Star",
					widget = { type = 'numBox',
						value = 85,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Divine Star at",
					},
				},
				{ 	name = "Divine Star Limit",
					enable = false,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 3,
						step = 1,
						max = 10,
						min = 0,
						tooltip = "The number of raid members around healing target to use Divine Star at",
					},
				},				
				{ 	name = "Desperate Prayer",
					enable = true,
					tooltip = "Enables the use of Desperate Prayer",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Desperate Prayer at",
					},
				},	
				{ 	name = "Hymn Of Hope",
					enable = true,
					tooltip = "Enables the use of Hymn Of Hope",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of Mana to use Hymn Of Hope at",
					},
				},	
				{ 	name = "Pain Suppression",
					enable = true,
					tooltip = "Enables the use of Pain Suppression",
					widget = { type = 'numBox',
						value = 35,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Pain Suppression at",
					},
				},	
				{ 	name = "Void Shift",
					enable = true,
					tooltip = "Enables the use of Void Shift",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of target HP to use Void Shift at",
					},
				},	
				{ 	name = "Self Void Shift",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of healer HP to use Void Shift at",
					},
				},					
			},
			hotkeys = {
			},
		}
		PQI_CD_Disc_Priest_GUI_Loaded = PQI:AddRotation(config)
	end		

	if not PQI_Healing_Disc_Priest_GUI_Loaded then 
		local config = {
			name	= 'Healing Disc Priest',
			author	= 'Vachiusa',
			abilities = {												
				-- Healing --
				{ 	name = "Renew",
					enable = true,
					tooltip = "Enables the use of Renew",
					widget = { type = 'numBox',
						value = 50,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Renew at",
					},
				},
				{ 	name = "Renew Tank",
					enable = true,
					tooltip = "Enables the use of Renew on Tanks",
					widget = { type = 'numBox',
						value = 90,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Renew on Tanks at",
					},
				},
				{ 	name = "Flash Heal",
					enable = true,
					tooltip = "Enables the use of Flash Heal",
					widget = { type = 'numBox',
						value = 20,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Flash Heal at",
					},
				},	
				{ 	name = "Greater Healing",
					enable = true,
					tooltip = "Enables the use of Greater Healing",
					widget = { type = 'numBox',
						value = 60,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Greater Healing at",
					},
				},	
				{ 	name = "Heal",
					enable = false,
					tooltip = "Enables the use of Heal",
					widget = { type = 'numBox',
						value = 70,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Heal at",
					},
				},	
				{ 	name = "Binding Heal",
					enable = true,
					tooltip = "Enables the use of Binding Heal",
					widget = { type = 'numBox',
						value = 40,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of target HP to use Binding Heal at",
					},
				},	
				{ 	name = "Self Binding Heal",
					enable = true,
					tooltip = "Not work",
					widget = { type = 'numBox',
						value = 70,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of healer HP to use Binding Heal at",
					},
				},	
				{ 	name = "Prayer Of Mending",
					enable = true,
					tooltip = "Enables the use of Prayer Of Mending",
					widget = { type = 'numBox',
						value = 100,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Prayer Of Mending at",
					},
				},	
				{ 	name = "PowerWord Shield",
					enable = true,
					tooltip = "Enables the use of PowerWord:Shield",
					widget = { type = 'numBox',
						value = 50,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use PowerWord:Shield at",
					},
				},	
				{ 	name = "PowerWord Shield Tank",
					enable = true,
					tooltip = "Enables the use of PowerWord:Shield on Tanks",
					widget = { type = 'numBox',
						value = 99,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use PowerWord:Shield on Tanks at",
					},
				},	
				{ 	name = "Penance",
					enable = true,
					tooltip = "Enables the use of Penance",
					widget = { type = 'numBox',
						value = 70,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Penance at",
					},
				},	
				{ 	name = "Tank Flask Heal",
					enable = true,
					tooltip = "Enables the use of Flask Heal on Tanks",
					widget = { type = 'numBox',
						value = 30,
						step = 1,
						max = 100,
						min = 0,
						tooltip = "The percent of HP to use Flask Heal on Tanks at",
					},
				},				
			},
			hotkeys = {
				{	name = "Pause Rotation",		enable = true,	hotkeys = {'ls'},	},
				{	name = "Spirit Shell",			enable = true,	hotkeys = {'rs'},	
					tooltip = "Pop Spirit Shell", },
				{	name = "PowerWord Barrier",		enable = true,	hotkeys = {'lc'},
					tooltip = "Use PowerWordBarrier at mouseover", },
				{	name = "DPS Only",			enable = false,	hotkeys = {'la'},	
					tooltip = "Use DPS Only mod switch", },
				{	name = "Mass Dispel",			enable = true,	hotkeys = {'ra'},	
					tooltip = "Use MassDispel at mouseover", },
				{	name = "Hymn Of Hope",		enable = true,	hotkeys = {'ls', 'ra'},	
					tooltip = "Pop Hymn of Hope", },						
				{	name	= "Adding Players CT",		enable	= true,	hotkeys	= {'ls', 'la'},
					tooltip = "Adding Players to Custom Table", },	
				{	name	= "Removing Players CT",		enable	= true,	hotkeys	= {'ls', 'lc'},
					tooltip = "Removing Players from Custom Table", },						
			},
		}
		PQI_Healing_Disc_Priest_GUI_Loaded = PQI:AddRotation(config)
	end
	if VaSpec ~= 256 then
		VaSpec = 256
		PQR_RotationChanged("Vachiusa Disc Priest")
	end

	-- Variables
	if PQI_General_Disc_Priest_GUI_Loaded and PQI_CD_Disc_Priest_GUI_Loaded and PQI_Healing_Disc_Priest_GUI_Loaded then
		PQI_Variables_Loaded = PQI_VachiusaGeneralDiscPriest_AutoOpenPQIOptions_enable
		VachiusaDiscPriest_AutoOpenPQIOptions_enable = PQI_VachiusaGeneralDiscPriest_AutoOpenPQIOptions_enable

		Vasa_RenewCheck = PQI_VachiusaHealingDiscPriest_Renew_enable
		Vasa_Renew = PQI_VachiusaHealingDiscPriest_Renew_value
		Vasa_RenewTankCheck = PQI_VachiusaHealingDiscPriest_RenewTank_enable
		Vasa_RenewTank = PQI_VachiusaHealingDiscPriest_RenewTank_value
		Vasa_FlashHealCheck = PQI_VachiusaHealingDiscPriest_FlashHeal_enable
		Vasa_FlashHeal = PQI_VachiusaHealingDiscPriest_FlashHeal_value
		Vasa_GreaterHealingCheck = PQI_VachiusaHealingDiscPriest_GreaterHealing_enable
		Vasa_GreaterHealing = PQI_VachiusaHealingDiscPriest_GreaterHealing_value
		Vasa_HealCheck = PQI_VachiusaHealingDiscPriest_Heal_enable
		Vasa_Heal = PQI_VachiusaHealingDiscPriest_Heal_value
		Vasa_BindingHealCheck = PQI_VachiusaHealingDiscPriest_BindingHeal_enable
		Vasa_BindingHeal = PQI_VachiusaHealingDiscPriest_BindingHeal_value
		Vasa_SelfBindingHealCheck = PQI_VachiusaHealingDiscPriest_SelfBindingHeal_enable
		Vasa_SelfBindingHeal = PQI_VachiusaHealingDiscPriest_SelfBindingHeal_value
		Vasa_PrayerOfMendingCheck = PQI_VachiusaHealingDiscPriest_PrayerOfMending_enable
		Vasa_PrayerOfMending = PQI_VachiusaHealingDiscPriest_PrayerOfMending_value
		Vasa_PowerWordShieldCheck = PQI_VachiusaHealingDiscPriest_PowerWordShield_enable
		Vasa_PowerWordShield = PQI_VachiusaHealingDiscPriest_PowerWordShield_value
		Vasa_PowerWordShieldTankCheck = PQI_VachiusaHealingDiscPriest_PowerWordShieldTank_enable
		Vasa_PowerWordShieldTank = PQI_VachiusaHealingDiscPriest_PowerWordShieldTank_value
		Vasa_PenanceCheck = PQI_VachiusaHealingDiscPriest_Penance_enable
		Vasa_Penance = PQI_VachiusaHealingDiscPriest_Penance_value
		Vasa_TankFlaskHealCheck = PQI_VachiusaHealingDiscPriest_TankFlaskHeal_enable
		Vasa_TankFlaskHeal = PQI_VachiusaHealingDiscPriest_TankFlaskHeal_value
		
		Vasa_PrayerOfHealingCheck = PQI_VachiusaCDDiscPriest_PrayerOfHealing_enable
		Vasa_PrayerOfHealing = PQI_VachiusaCDDiscPriest_PrayerOfHealing_value
		Vasa_PrayerOfHealingLimitCheck = PQI_VachiusaCDDiscPriest_PrayerOfHealingLimit_enable
		Vasa_PrayerOfHealingLimit = PQI_VachiusaCDDiscPriest_PrayerOfHealingLimit_value
		Vasa_CascadeCheck = PQI_VachiusaCDDiscPriest_Cascade_enable
		Vasa_Cascade = PQI_VachiusaCDDiscPriest_Cascade_value
		Vasa_CascadeLimitCheck = PQI_VachiusaCDDiscPriest_CascadeLimit_enable
		Vasa_CascadeLimit = PQI_VachiusaCDDiscPriest_CascadeLimit_value
		Vasa_HaloCheck = PQI_VachiusaCDDiscPriest_Halo_enable
		Vasa_Halo = PQI_VachiusaCDDiscPriest_Halo_value
		Vasa_HaloLimitCheck = PQI_VachiusaCDDiscPriest_HaloLimit_enable
		Vasa_HaloLimit = PQI_VachiusaCDDiscPriest_HaloLimit_value
		Vasa_DivineStarCheck = PQI_VachiusaCDDiscPriest_DivineStar_enable
		Vasa_DivineStar = PQI_VachiusaCDDiscPriest_DivineStar_value
		Vasa_DivineStarLimitCheck = PQI_VachiusaCDDiscPriest_DivineStarLimit_enable
		Vasa_DivineStarLimit = PQI_VachiusaCDDiscPriest_DivineStarLimit_value	
		Vasa_DesperatePrayerCheck = PQI_VachiusaCDDiscPriest_DesperatePrayer_enable
		Vasa_DesperatePrayer = PQI_VachiusaCDDiscPriest_DesperatePrayer_value
		Vasa_HymnOfHopeCheck = PQI_VachiusaCDDiscPriest_HymnOfHope_enable
		Vasa_HymnOfHope = PQI_VachiusaCDDiscPriest_HymnOfHope_value
		Vasa_PainSuppressionCheck = PQI_VachiusaCDDiscPriest_PainSuppression_enable
		Vasa_PainSuppression = PQI_VachiusaCDDiscPriest_PainSuppression_value
		Vasa_VoidShiftCheck = PQI_VachiusaCDDiscPriest_VoidShift_enable
		Vasa_VoidShift = PQI_VachiusaCDDiscPriest_VoidShift_value
		Vasa_SelfVoidShiftCheck = PQI_VachiusaCDDiscPriest_SelfVoidShift_enable
		Vasa_SelfVoidShift = PQI_VachiusaCDDiscPriest_SelfVoidShift_value
			
		Vasa_AutoTargetCheck = PQI_VachiusaGeneralDiscPriest_AutoTarget_enable
		Vasa_AutoTarget = PQI_VachiusaGeneralDiscPriest_AutoTarget_value
		Vasa_MindbenderCheck = PQI_VachiusaGeneralDiscPriest_Mindbender_enable
		Vasa_Mindbender = PQI_VachiusaGeneralDiscPriest_Mindbender_value
		Vasa_SolaceInsanityCheck = PQI_VachiusaGeneralDiscPriest_SolaceInsanity_enable
		Vasa_SolaceInsanity = PQI_VachiusaGeneralDiscPriest_SolaceInsanity_value
		Vasa_DPSCheck = PQI_VachiusaGeneralDiscPriest_DPS_enable
		Vasa_DPS = PQI_VachiusaGeneralDiscPriest_DPS_value
		Vasa_PurifyCheck = PQI_VachiusaGeneralDiscPriest_Purify_enable
		Vasa_Purify = PQI_VachiusaGeneralDiscPriest_Purify_value
		Vasa_FadeCheck = PQI_VachiusaGeneralDiscPriest_Fade_enable
		Vasa_Fade = PQI_VachiusaGeneralDiscPriest_Fade_value
		Vasa_InnerCheck = PQI_VachiusaGeneralDiscPriest_Inner_enable
		Vasa_Inner = PQI_VachiusaGeneralDiscPriest_Inner_value		
		Vasa_PowerWordShieldMovingCheck = PQI_VachiusaGeneralDiscPriest_PowerWordShieldMoving_enable
		Vasa_RacialsCheck = PQI_VachiusaGeneralDiscPriest_Racials_enable
		Vasa_Racials = PQI_VachiusaGeneralDiscPriest_Racials_value
		Vasa_4xEventsCheck = PQI_VachiusaGeneralDiscPriest_4xEvents_enable
		Vasa_4xEvents = PQI_VachiusaGeneralDiscPriest_4xEvents_value
		Vasa_53EventsCheck = PQI_VachiusaGeneralDiscPriest_53Events_enable
		Vasa_53Events = PQI_VachiusaGeneralDiscPriest_53Events_value
		Vasa_54EventsCheck = PQI_VachiusaGeneralDiscPriest_54Events_enable
		Vasa_54Events = PQI_VachiusaGeneralDiscPriest_54Events_value	
		Vasa_SpecialEvents = PQI_VachiusaGeneralDiscPriest_SpecialEvents_enable	
		Vasa_AutoEventDispel = PQI_VachiusaGeneralDiscPriest_AutoEventDispel_enable
		Vasa_QueueSysCheck = PQI_VachiusaGeneralDiscPriest_QueueSys_enable
		Vasa_QueueSys = PQI_VachiusaGeneralDiscPriest_QueueSys_value		
		Vasa_Mouseover = PQI_VachiusaGeneralDiscPriest_MouseoverHeal_enable
		Vasa_TargetHeal = PQI_VachiusaGeneralDiscPriest_TargetHeal_enable
		Vasa_NPCMouseoverHeal = PQI_VachiusaGeneralDiscPriest_NPCMouseoverHeal_enable
		Vasa_PetHeal = PQI_VachiusaGeneralDiscPriest_PetHeal_enable
		Vdebug = PQI_VachiusaGeneralDiscPriest_Vdebug_enable
		Vasa_StopCasting = PQI_VachiusaGeneralDiscPriest_StopCasting_enable
		
		if Vasa_LowHP == nil then Vasa_LowHP = 80 end
		if Vasa_ActualHP == nil or Vasa_ActualHP then Vasa_ActualHP = false end
		
		-- Hotkeys
		if not PQI_Hotkeys_Functions_Set then
			function PQI_PauseRotation()
				if PQI_VachiusaHealingDiscPriest_PauseRotation_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_PauseRotation_key) then
				return true else return false 
			end	end
			function PQI_SpiritShell()
				if PQI_VachiusaHealingDiscPriest_SpiritShell_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_SpiritShell_key) then
				return true else return false
			end	end		
			function PQI_PowerWordBarrier()
				if PQI_VachiusaHealingDiscPriest_PowerWordBarrier_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_PowerWordBarrier_key) then
				return true else return false
			end	end			
			function PQI_DPSOnly()
				if PQI_VachiusaHealingDiscPriest_DPSOnly_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_DPSOnly_key) then
				return true else return false
			end	end	
			function PQI_MassDispel()
				if PQI_VachiusaHealingDiscPriest_MassDispel_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_MassDispel_key) then
				return true else return false
			end	end	
			function PQI_HymnOfHope()
				if PQI_VachiusaHealingDiscPriest_HymnOfHope_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_HymnOfHope_key) then
				return true else return false
			end	end		
			function PQI_AddingPlayersCT()
				if PQI_VachiusaHealingDiscPriest_AddingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_AddingPlayersCT_key) then
				return true else return false
			end	end	
			function PQI_RemovingPlayersCT()
				if PQI_VachiusaHealingDiscPriest_RemovingPlayersCT_enable and PQI:IsHotkeys(PQI_VachiusaHealingDiscPriest_RemovingPlayersCT_key) then
				return true else return false
			end	end			
		end	
		
		Vasa_PauseRotationCheck = PQI_VachiusaHealingDiscPriest_PauseRotation_enable
		Vasa_SpiritShellCheck = PQI_VachiusaHealingDiscPriest_SpiritShell_enable
		Vasa_PowerWordBarrierCheck = PQI_VachiusaHealingDiscPriest_PowerWordBarrier_enable
		Vasa_DPSOnlyCheck = PQI_VachiusaHealingDiscPriest_DPSOnly_enable
		Vasa_MassDispelCheck = PQI_VachiusaHealingDiscPriest_MassDispel_enable
		Vasa_MHymnOfHopeCheck = PQI_VachiusaHealingDiscPriest_HymnOfHope_enable
		Vasa_AddingPlayersCTCheck = PQI_VachiusaHealingDiscPriest_AddingPlayersCT_enable
		Vasa_RemovingPlayersCTCheck = PQI_VachiusaHealingDiscPriest_RemovingPlayersCT_enable
		
		VachiusaDiscPriest_PauseRotation_key = PQI_PauseRotation()
		VachiusaDiscPriest_SpiritShell_key = PQI_SpiritShell()
		VachiusaDiscPriest_PowerWordBarrier_key = PQI_PowerWordBarrier()
		VachiusaDiscPriest_DPSOnly_key = PQI_DPSOnly()
		VachiusaDiscPriest_MassDispel_key = PQI_MassDispel()
		VachiusaDiscPriest_HymnOfHope_key = PQI_HymnOfHope()
		VachiusaDiscPriest_AddingPlayersCT_key = PQI_AddingPlayersCT()
		VachiusaDiscPriest_RemovingPlayersCT_key = PQI_RemovingPlayersCT()	

		--Set PQI
		if not PQI_VachiusaDiscPriest_Set and VachiusaDiscPriest_AutoOpenPQIOptions_enable ~= nil then
			VAS_RunMacroText("/PQI show")
			VAS_RunMacroText("/PQI config show")
			VAS_RunMacroText("/PQI config width 220")
			if not VachiusaDiscPriest_AutoOpenPQIOptions_enable then
			VAS_RunMacroText("/PQI config hide") end
			PQI_VachiusaDiscPriest_Set = true
		end
	end

	
	if PQI_Variables_Loaded == nil then
		if not VSIWarning2 then
			VAS_WriteToChat("\124cFFFF55FFWarning: something wrong with VSI addon!")
			VSIWarning2 = true
		end
		return true
	end

	if not VAS_RotationStarted then
		if UnitLevel("player") ~= 90 then
			VAS_WriteToChat("\124cFFFF55FFWarning: only takes full effect when we're 90!")	
			return true --added
		end	
		QueueSystem()
		VAS_RotationStarted = true
	end

	if VAS_Moving("player") then
		Vasa_Moving = true
	else
		Vasa_Moving = false
	end

	-- Custom Table --
	--------------------------------------
	-- Adding Players to Custom Table
	--------------------------------------
	if Vasa_AddingPlayersCTCheck then
		if VachiusaDiscPriest_AddingPlayersCT_key
		and not GetCurrentKeyBoardFocus()
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") ) then  
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					return false
				end
			end
			
			table.insert(Vasa_CustomT, { GUID = UnitGUID("mouseover") } )
			
			if not GetCVarBool("Vasa_Recording") then
				VAS_WriteToChat("We just added "..UnitName("mouseover").." to the Custom Healing Table.", "Alert")
			end
			return true
		
		end
	end

	--------------------------------------
	-- Removing Players from Custom Table
	--------------------------------------
	if Vasa_RemovingPlayersCTCheck then
		if VachiusaDiscPriest_RemovingPlayersCT_key
		and not GetCurrentKeyBoardFocus() 
		and UnitExists("mouseover")
		and ( CanHeal("mouseover") 
		or UnitIsUnit("player", "mouseover") )then
			for i=1, #Vasa_CustomT do
				if Vasa_CustomT[i].GUID and Vasa_CustomT[i].GUID == UnitGUID("mouseover") then
					if not GetCVarBool("Vasa_Recording") then
						VAS_WriteToChat("We just removed "..UnitName(Vasa_CustomT[i].Unit).." from the Custom Healing Table.", "Alert")
					end
					table.remove(Vasa_CustomT, i)
					return true
				end
			end
		end
	end

	-- Pause
	if (VachiusaDiscPriest_PauseRotation_key and not GetCurrentKeyBoardFocus())
	 or UnitIsDeadOrGhost("player") 
	 or IsMounted() 
	 or (UnitChannelInfo("player") == GetSpellInfo(64901)) --Hymn of Hope
	 or UnitBuffID("player", 104269) then --drink 
		if PQI_VachiusaGeneral_RotationEngine_value == 4 then
			raidfu = nil
			vicon = nil
			CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
		elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
			raidfu = nil
			vicon = nil
			ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)
		end
		return true
	end

	-- Healing Engine --
	-- Healing Engine --
	if Vasa_54EventsCheck then
		if not UnitDebuffID("player",144850) --Test of Reliance
		and not UnitDebuffID("player",142861) then --Ancient Miasma
			SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
		end
	else
		SheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_SpecialEvents, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true	
	end

	if GetCVarBool("PQ_UseCustomT") then
		members = Vasa_CustomT
		lowhpmembers = 0
		for i=1, #Vasa_CustomT do
			if Vasa_CustomT[i].HP < 80 then
				lowhpmembers = lowhpmembers + 1
			end
		end
		
		table.sort(members, function(x,y) return x.HP < y.HP end)
	end

	-- 54Events
	if Vasa_54EventsCheck 
	and UnitAffectingCombat("player") then
		local boss,bossid = bossid()
		local dispelid = 527		
		local dispelmagicid = 528
		local rangecheckid = 2050
		local buff = { }	
		stopcasting = false
		stopfade = false
		stopdps = false
		LLdebuff = false
		LLdebuffunit = false
		if UnitExists(boss) then
			--local _, _, rdifficulty = GetInstanceInfo()
			if bossid == 71515 then --General Nazgrim
				if UnitBuffID("boss1", 143593) then --Defensive Stance
					stopdps = true				
				else
					stopdps = false
				end
			elseif bossid == 71995 or bossid == 71996 or bossid == 72000 then --Amalgam of Corruption - Norushen
				if UnitDebuffID("player",144850) --Test of Reliance
				then 
					BossSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, 3, true, rangecheckid)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true
					local buff  = { 144514 } --Lingering Corruption
					RaidDispel(dispelid,buff) 	
				end
			elseif bossid == 71475 or bossid == 71479 or bossid == 71480 then --The Fallen Protectors
				local buff  = { 143434 } --Shadow Word: Bane
				RaidDispel(dispelid,buff) 	
			elseif bossid == 71734 then --Sha of Pride
				if UnitDebuffID("player",144359) then
					local buff  = { 144351 } --Mark of Arrogance
					RaidDispel(dispelid,buff) 			
				end
			elseif bossid == 71454 then --Malkorok	
				local buff  = { 142913 } 	
				RaidRangeDispel(dispelid,buff,8) 	
				if UnitDebuffID("player",142861) then --Ancient Miasma			
					ShieldSheuronEngine(Vasa_Mouseover, Vasa_LowHP, Vasa_ActualHP, Vasa_TargetHeal, Vasa_PetHeal)  -- Deactivate Mouseover  ||   At what % Health do we consider someone LowHP  ||  Sort by Actual Health = true					
				end
			elseif bossid == 71161 and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8 then --Kil'ruk the Wind-Reaver - Paragons of the Klaxxi
				if UnitDebuffID("player",141858) then --Ingenious			
					if not tIngenious or (#tIngenious > 0 and (GetTime() > tIngenious[1].Time + 30)) then
						tIngenious = { }						
						local qTime = GetTime() 
						local lastmax = 0
						local maxunit = "player"		
						local lasttype = "notype"						
						local ClassList = { {'WARRIOR', 0 }, {'PALADIN', 0 }, {'HUNTER', 0 }, {'ROGUE', 0 }, {'PRIEST', 0 }, {'DEATHKNIGHT', 0 }, {'SHAMAN', 0 }, {'MAGE', 0 }, {'WARLOCK', 0 }, {'MONK', 0 }, {'DRUID', 0 } }				
						local RaceList = { {'Draenei', 0 }, {'Gnome', 0 }, {'Human', 0 }, {'NightElf', 0 }, {'Worgen', 0 }, {'Pandaren', 0 }, {'BloodElf', 0 }, {'Goblin', 0 }, {'Orc', 0 }, {'Tauren', 0 }, {'Troll', 0 }, {'Scourge', 0 } }
						for i=1,25 do
							local unitCheck = "raid"..i
						    if UnitExists(unitCheck) and UnitIsPlayer(unitCheck) then
							local _, unitClass = UnitClass(unitCheck)				    	
							local _, unitRace = UnitRace(unitCheck)				    	
							if unitClass and UnitRace then	
									--Class
									for j=1, #ClassList do
										if unitClass == ClassList[j][1] then
											VAS_WriteToChat("Debug1 - Num: " ..ClassList[j][2].." - Class: " ..ClassList[j][1])
											ClassList[j][2] = ClassList[j][2] + 1
											if ClassList[j][2] > lastmax then
												lastmax = ClassList[j][2]
												maxunit = unitCheck
												lasttype = ClassList[j][1]
											end												
										end		
									end
									--Race
									for j=1, #RaceList do
										if unitRace == RaceList[j][1] then
											VAS_WriteToChat("Debug1 - Num: " ..RaceList[j][2].." - Race: " ..RaceList[j][1])
											RaceList[j][2] = RaceList[j][2] + 1
											if RaceList[j][2] > lastmax then
												lastmax = RaceList[j][2]
												maxunit = unitCheck
												lasttype = RaceList[j][1]
											end												
										end		
									end
							end			               	
						    end
						end				
						VAS_WriteToChat("Debug1 - Unit: " ..maxunit.." - Type: " ..lasttype.." - Total: " ..lastmax.." - Time: " ..qTime)		
						table.insert(tIngenious, { Unit = maxunit, Type = lasttype, Total = lastmax, Time = qTime } )			
						return true								
					else
						if #tIngenious > 0 then			
							if UnitExists(tIngenious[1].Unit) 
							and IsSpellInRange(GetSpellInfo(rangecheckid),tIngenious[1].Unit) == 1
							and CanHeal(tIngenious[1].Unit) then	
							VAS_TargetUnit(tIngenious[1].Unit) 
						--Press the ExtraActionButton 
						VAS_RunMacroText("/click ExtraActionButton1")                     
						VAS_RunMacroText("/targetlasttarget")
						VAS_WriteToChat("Ingenious Name: "..UnitName(tIngenious[1].Unit).." - Type: "..tIngenious[1].Type.." - Total: "..tIngenious[1].Total.." - Time: "..tIngenious[1].Time)						        					        	   	
							end
						end				
					end   				
				else
					tIngenious = false
				end
			elseif bossid == 71529 then --Thok the Bloodthirsty
				local buff  = { 143791 } --Corrosive Blood
				RaidDispel(dispelid,buff) 
				local DeafeningScreech = GetSpellInfo(143343) --Deafening Screech
				local bossCasting,_,_,_,_,castEnd = UnitCastingInfo(boss) 
				if (bossCasting == DeafeningScreech) then
					stopcasting = true
				end							
			end	
		end
	end

	-- QueueSys
	if Vasa_QueueSysCheck 
	then
		local dispelid = 527		
		local dispelmagicid = 528
		local rangecheckid = 2050
		if #Queue_Sys > 0 then	
			if VAS_SpellAvailable(dispelid) 
			--and select(2,GetSpellCooldown(dispelid)) < 2
			and UnitExists(Queue_Sys[1].Unit)
			and IsUsableSpell(dispelid)
			and IsSpellInRange(GetSpellInfo(dispelid),Queue_Sys[1].Unit) == 1
			and CanHeal(Queue_Sys[1].Unit)
			and not VAS_IsOutOfSight(Queue_Sys[1].Unit) then
				if not UnitChannelInfo("player")
				and not UnitCastingInfo("player") 
				then	
					VAS_Cast(dispelid,Queue_Sys[1].Unit)					
					return true	
				end
			end
		end
		
		if Queue_Spell then
			if #Queue_Spell > 0 then	
				if GetTime() - Queue_Spell[1].Time >= 10 then
					VAS_WriteToChat("Removed expired queue "..Queue_Spell[1].SpellID)
					Queue_Spell = { }				
					return true
				end			
				if #Queue_Spell > 1 then			
					if Queue_Spell[1].SpellID == Queue_Spell[2].SpellID and Queue_Spell[1].Unit == Queue_Spell[2].Unit then
						VAS_WriteToChat("Removed dup queue "..Queue_Spell[1].SpellID)
						table.remove(Queue_Spell,2)	
						return true	
					end
				end
				
				local qunit = "player"
				if Queue_Spell[1].Unit == "low" then
					qunit = members[1].Unit
				elseif Queue_Spell[1].Unit == "tank" then
					if #Vasa_Tanks > 0 then
						for i=1, #Vasa_Tanks do
							if UnitThreatSituation(Vasa_Tanks[i].Unit) then
								qunit = Vasa_Tanks[i].Unit
								break
							end
						end
					end
					if UnitThreatSituation(members[1].Unit)	== 3 then
						qunit = members[1].Unit
					end			
				else
					qunit = Queue_Spell[1].Unit
				end
				
				if VAS_SpellAvailable(tonumber(Queue_Spell[1].SpellID)) 
				--and select(2,GetSpellCooldown(tonumber(Queue_Spell[1].SpellID))) < 2
				and UnitExists(qunit)
				then
					if not UnitChannelInfo("player")
					and not UnitCastingInfo("player") 
					then					
						local qmembers = members
						table.sort(qmembers, function(x) return UnitIsUnit(qunit,x.Unit) end)
						if UnitIsUnit(qmembers[1].Unit,qunit) then
							qunit = qmembers[1].Unit	
						else
							if IsSpellInRange(GetSpellInfo(Queue_Spell[1].SpellID),Queue_Spell[1].Unit) then
								qunit = Queue_Spell[1].Unit	
							else
								qunit = "player"				
							end
						end
						SpellSUCCEEDED(Queue_Spell[1].SpellID,qunit)
						VAS_Cast(Queue_Spell[1].SpellID,qunit)									
						return true					
					end
				end						
			end
		end	
	end

	-- ModKey
	-- DPS Burst toggle function
	if Vasa_DPSOnlyCheck then
		if not DPSBurstMode then DPSBurstMode = false end
		if not DPSBurstModetimer then DPSBurstModetimer = 0 end
		if (VachiusaDiscPriest_DPSOnly_key and not GetCurrentKeyBoardFocus()) and GetTime() - DPSBurstModetimer > 1 then
			DPSBurstModetimer = GetTime()	
			if DPSBurstMode then
				DPSBurstMode = false
				print("|cff347C2CDPS Burst Mode: |cffDC143COff|cffffffff")
			else
				DPSBurstMode = true
				print("|cff347C2CDPS Burst Mode: |cff79BAECOn|cffffffff")		
			end
		end
	end

	--NPCMouseoverHeal
	if Vasa_NPCMouseoverHeal
	and UnitAffectingCombat("player")
	then
		local dispelid = 527		
		local dispelmagicid = 528
		local rangecheckid = 2050	
		if UnitExists("mouseover")				
		and not UnitIsPlayer("mouseover") then
			local npcID = tonumber(UnitGUID("mouseover"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then				
				if IsSpellInRange(GetSpellInfo(rangecheckid),"mouseover") --FlashHeal
				and Vasa_UnitInfo("mouseover") < 100 then	
					if VAS_SpellAvailable(47540)  
					 and IsUsableSpell(47540) 
					 and not UnitChannelInfo("player")
					 and not UnitCastingInfo("player") then				
						VAS_Cast(47540,"mouseover")	 			 		
						VAS_WriteToChat("\124cFFFF55FFCast Penance - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
						return true
					end
																								
					if VAS_SpellAvailable(2061) 		 
					 and IsUsableSpell(2061) 
					 and select(3, Vasa_UnitInfo("player")) > 70
					 and not UnitChannelInfo("player")
					 and not UnitCastingInfo("player") then
						VAS_Cast(2061,"mouseover")	 			 		
						VAS_WriteToChat("\124cFFFF55FFCast FlashHeal - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
						return true
					end
					
					if VAS_SpellAvailable(2060)  
					and IsUsableSpell(2060)
					and not UnitChannelInfo("player")
					and not UnitCastingInfo("player") then 					
						VAS_Cast(2060,"mouseover")	 						 		
						VAS_WriteToChat("\124cFFFF55FFCast GreaterHeal - Name: " ..UnitName("mouseover").." - HP: "..Vasa_UnitInfo("mouseover").." - NPCID: "..npcID) 	
						return true
					end									
				end
			end		
		elseif UnitExists("focus")				
		and not UnitIsPlayer("focus") then
			local npcID = tonumber(UnitGUID("focus"):sub(6,10), 16) 				
			if npcID == 71604 --Contaminated Puddle - Immerseus - SoO
			or npcID == 71995 or npcID == 71996 or npcID == 72000 --Norushen
			or npcID == 71357 --Wrathion 
			then
				if IsSpellInRange(GetSpellInfo(rangecheckid),"focus") --FlashHeal
				then		
					local focushp = CalculateHP("focus")
					if focushp ~= nil and select(2, CalculateHP("focus")) ~= nil then
						table.insert(members, { Unit = "focus", HP = focushp, AHP = select(2, CalculateHP("focus")), IsNPC = true } )
					end
					if #members > 0 then
						table.sort(members, function(x,y) return x.HP < y.HP end)
					end				
				end
			end	
		end
	end

	-- Drink
	if 100 * UnitPower("player") / UnitPowerMax("player") <= 50
	and not UnitCastingInfo("player")
	and not UnitAffectingCombat("player") 
	and VAS_SpellAvailable(80618) --Mage cookies	
	and not UnitBuffID("player", 104269)
	and not Vasa_Moving 
	and GetItemCount(80618) > 0
	and GetItemCooldown(80618) == 0 then
		VAS_UseItemByName(80618)
		--VAS_WriteToChat("\124cFFFF55FFMage cookies - HP: " ..Vasa_UnitInfo("player")) 
		return true
	end

	--DivineStar
	if Vasa_DivineStarCheck then
		if not DS_Queue then DS_Queue = {} end	
		if select(2,GetTalentRowSelectionInfo(6)) == 17 then
			if select(2,GetSpellCooldown(110744)) > 2 then	
				DS_Queue = {}
				if aDSturn then
					aDSturn = false
					TurnRightStop() TurnLeftStop() 	 
				end
			end
			if #DS_Queue > 0 then
				if (GetTime() - DS_Queue[1].Time) > 3 then	
					DS_Queue = {}
					aDSturn = false
					TurnRightStop() TurnLeftStop() 	 				
				end
			end		
			if Vasa_Moving and aDSturn then
				DS_Queue = {}
				aDSturn = false
				TurnRightStop() TurnLeftStop() 	 		
			end	
		end
	end

	if Vasa_DivineStarCheck
	and VAS_SpellAvailable(110744) 
	and select(2,GetTalentRowSelectionInfo(6)) == 17		
	--and select(2,GetSpellCooldown(110744)) < 2
	and not stopdps		
	and not UnitChannelInfo("player")	
	and not UnitCastingInfo("player")
	and UnitAffectingCombat("player") 
	then	
		if lowhpmembers >= Vasa_DivineStarLimit then		
			if #DS_Queue < 1 then
				PRGetDistanceTable(Vasa_DivineStar, 4, Vasa_DivineStarLimit)	
				PRGetDistanceTablebyHP(Vasa_DivineStar,Vasa_DivineStarLimit)
													
				if IsSpellInRange(GetSpellInfo(2050),prdistancebyhp[1].Unit) == 1 --30 yards
				and not UnitIsUnit(prdistancebyhp[1].Unit, "player")
				and (prdistancebyhp[1].PD >= Vasa_DivineStarLimit)
				and prdistancebyhp[1].HP <= Vasa_DivineStar then
					table.insert(DS_Queue, { Unit = prdistancebyhp[1].Unit, Time = GetTime() } )
				end	
			end
			
			if #DS_Queue > 0 then
				local DSUnit = DS_Queue[1].Unit
				local px, tx, angle, dwt = VUnitFacing(DSUnit)
				if px ~= 0 
				and tx ~= 0 
				and not IsMouselooking()
				and dwt <= 30 then	
					if angle > 0 
					and angle < 16 then 
						aDSturn = true
						TurnLeftStart() 			
						VAS_WriteToChat("\124cFFFF55FFTurn Left")	
					end
					if angle > 15 
					and angle < 31 then 
						aDSturn = true
						TurnRightStart() 				
						VAS_WriteToChat("\124cFFFF55FFTurn Right")	
					end
					if angle == 31 
					or angle == 0 then 			
						TurnRightStop() TurnLeftStop() 	      		
						VAS_Cast(110744,nil)
						VAS_WriteToChat("\124cFFFF55FFCast "..GetSpellInfo(110744).." - Name: " ..UnitName(DSUnit))					
					end						
				else
					DS_Queue = {}
				end			
				return true	
			end		
		end		
	end

	--Stop Casting
	if Vasa_StopCasting then
		if Vasa_DPSOnlyCheck and DPSBurstMode then
			return false
		end
		if UnitExists("boss1") then
			local npcid = tonumber(UnitGUID("boss1" ):sub(6,10), 16)
		else
			local npcid = 0
		end
		
		if SpellIsTargeting() then
			VAS_SpellStopCasting()
		elseif ((UnitCastingInfo("player") == GetSpellInfo(2050)) --Heal
		or (UnitCastingInfo("player") == GetSpellInfo(585))) --Smite
		and (CalStop(members[1].Unit) < 40 or (lowhpmembers > 3 and CalStop(members[1].Unit) < 70)) 
		and select(3, Vasa_UnitInfo("player")) >= 12 --prevent stop loop
		and IsUsableSpell(2061) --prevent stop loop
		and UnitAffectingCombat("player") then
			if UnitBuffID("player", 81661) and (UnitCastingInfo("player") == GetSpellInfo(585)) then
				if select(4, UnitBuffID("player", 81661)) == 5 then
					VAS_SpellStopCasting() 
					VAS_WriteToChat("\124cFFFF55FFStop Casting Heal/Smite - HP: " ..members[1].HP) 		
					return true 
				end
			elseif (UnitCastingInfo("player") == GetSpellInfo(2050)) then
				VAS_SpellStopCasting() 
				VAS_WriteToChat("\124cFFFF55FFStop Casting Heal/Smite - HP: " ..members[1].HP) 		
				return true 
			end
		elseif (UnitCastingInfo("player") == GetSpellInfo(2050)) --Heal
		and IsSpellInRange(GetSpellInfo(2050),members[1].Unit) == 1
		and CalStop(members[1].Unit) > Vasa_DPS and CalStop(members[1].Unit) > 95 
		and UnitAffectingCombat("player") then
			VAS_SpellStopCasting() 	
			VAS_WriteToChat("\124cFFFF55FFStop Cast Heal - Name: " ..UnitName(members[1].Unit).." - Current HP: "..CalStop(members[1].Unit).." - overheal: "..select(2, CalStop(members[1].Unit)))	
			return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(2060)) --GreaterHeal
		and IsSpellInRange(GetSpellInfo(2060),members[1].Unit) == 1
		and npcid ~= 62442 --Tsulong 
		and npcid ~= nil
		and CalStop(members[1].Unit) > Vasa_GreaterHealing and CalStop(members[1].Unit) > Vasa_DPS 
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting GreaterHeal - HP: " ..members[1].HP) 		
			return true 
		elseif (UnitCastingInfo("player") == GetSpellInfo(2061)) --FlashHeal
		and IsSpellInRange(GetSpellInfo(2061),members[1].Unit) == 1
		and npcid ~= 62442 --Tsulong 
		and npcid ~= nil
		and CalStop(members[1].Unit) > Vasa_FlashHeal and CalStop(members[1].Unit) > Vasa_DPS 
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting FlashHeal - HP: " ..members[1].HP) 		
			return true 	
		elseif (UnitCastingInfo("player") == GetSpellInfo(596)) --PrayerOfHealing
		and not UnitBuffID("player", 109964)
		and (CalStop(members[1].Unit) > 95 or (lowhpmembers < 3 and CalStop(members[1].Unit) > 90)) 
		and not UnitDebuffID("player",116260)
		and UnitAffectingCombat("player") then 
			VAS_SpellStopCasting() 
			VAS_WriteToChat("\124cFFFF55FFStop Casting PrayerOfHealing - HP: " ..members[1].HP) 		
			return true 	
		end
	end

	--AutoTarget
	if Vasa_AutoTargetCheck then
		if (not UnitExists("focus")
			or UnitIsDeadOrGhost("focus")
			or not UnitInRange("focus") 
			or not UnitIsConnected("focus")
			or not UnitCanCooperate("player","focus"))
		and (UnitIsDeadOrGhost("target") 
			or not UnitExists("target"))
		and PQI_VachiusaGeneral_RotationEngine_value ~= 4 and PQI_VachiusaGeneral_RotationEngine_value ~= 7 and PQI_VachiusaGeneral_RotationEngine_value ~= 8
		and #Vasa_Tanks > 0 then
			for i=1, #Vasa_Tanks do
				if UnitThreatSituation(Vasa_Tanks[i].Unit) == 3			
				and UnitAffectingCombat("player")		 
				then			
					VAS_AutoFocus(Vasa_Tanks[i].Unit)
					--VAS_TargetUnit(Vasa_Tanks[i].Unit)             		
					--VAS_RunMacroText("/focus")			
					--VAS_RunMacroText("/targetlasttarget")			
				end
			end
		end
		
		if UnitExists("focus")
		and not Vasa_Moving
		and (UnitIsDeadOrGhost("target") or not UnitExists("target"))
		and not UnitIsDeadOrGhost("focustarget")
		and not UnitIsDeadOrGhost("focus")
		and UnitExists("focustarget")
		and UnitCanAttack("player", "focustarget")
		and IsSpellInRange(GetSpellInfo(14914),"focustarget") == 1
		and not VAS_IsOutOfSight("focustarget")
		and UnitAffectingCombat("player") then
			VAS_TargetUnit("focustarget")
			return false 	
		end
	end

	--InnerFire
	if not UnitBuffID("player",588) 
	and VAS_SpellAvailable(588)
	and select(3, Vasa_UnitInfo("player")) > 80
	and Vasa_InnerCheck
	and not UnitChannelInfo("player")
	and not UnitCastingInfo("player") then
		--print("Debug")
		VAS_Cast(588,nil)
		--VAS_WriteToChat("\124cFFFF55FFInnerFire - HP: " ..members[1].HP) 
		return true
	end

	--InnerWill
	if not UnitBuffID("player",73413) 
	and VAS_SpellAvailable(73413)
	and select(3, Vasa_UnitInfo("player")) < 70
	and Vasa_InnerCheck
	and not UnitChannelInfo("player")
	and not UnitCastingInfo("player") then
		VAS_Cast(73413,nil)
		--VAS_WriteToChat("\124cFFFF55FFInnerWill - HP: " ..members[1].HP) 
		return true
	end

	--PowerWordFortitude
	if not UnitBuffID("player",21562) --Power Word: Fortitude
	and not UnitBuffID("player",469) --Commanding Shout
	and not UnitBuffID("player",90364) --Qiraji Fortitude
	and not UnitBuffID("player",109773) --Dark Intent
	and VAS_SpellAvailable(21562)
	and IsUsableSpell(21562) 
	and not UnitChannelInfo("player")
	and not UnitCastingInfo("player") then
		VAS_Cast(21562,nil)
		--VAS_WriteToChat("\124cFFFF55FFPowerWordFortitude - HP: " ..members[1].HP) 
		return true
	end

	if Vasa_VoidShiftCheck then
		if VAS_SpellAvailable(108968) 
		 and Vasa_UnitInfo("focus") < Vasa_VoidShift
		 and Vasa_UnitInfo("player") > Vasa_SelfVoidShift
		 and UnitExists("focus") 
		 and UnitAffectingCombat("player") 
		 and CanHeal("focus") 
		 and IsSpellInRange(GetSpellInfo(108968),"focus") == 1 then 	
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end
			VAS_Cast(108968,"focus")
			--VAS_WriteToChat("\124cFFFF55FFVoid Shift - HP: " ..Vasa_UnitInfo("focus")) 		
			return true	
		end
	end

	if Vasa_PainSuppressionCheck then
		if VAS_SpellAvailable(33206) 
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(33206)) < 2
		 and UnitThreatSituation(members[1].Unit) == 3
		 and IsUsableSpell(33206)
		 and IsSpellInRange(GetSpellInfo(33206),members[1].Unit) == 1 then
			if members[1].HP < Vasa_PainSuppression 
			and UnitIsPlayer(members[1].Unit) then
				if UnitCastingInfo("player") then
					VAS_SpellStopCasting()
				end
				VAS_Cast(33206,members[1].Unit)
				--VAS_WriteToChat("\124cFFFF55FFPain Suppression - HP: " ..members[1].HP) 		
				return true
			end
		end
	end

	if Vasa_PowerWordBarrierCheck then	
		if (VachiusaDiscPriest_PowerWordBarrier_key and not GetCurrentKeyBoardFocus())
		and not UnitChannelInfo("player") --Hymn
		and IsUsableSpell(62618) 
		and VAS_SpellAvailable(62618)
		--and select(2,GetSpellCooldown(62618)) < 2 
		and UnitAffectingCombat("player")
		then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end	
			VAS_aoeCast(62618,nil)
			--if SpellIsTargeting() then CameraOrSelectOrMoveStart() CameraOrSelectOrMoveStop() end  
			--VAS_WriteToChat("\124cFFFF55FFLeft Control Key Down - PowerWordBarrier!")
			return true
		end
	end

	if Vasa_MassDispelCheck then	
		if (VachiusaDiscPriest_MassDispel_key and not GetCurrentKeyBoardFocus())
		and not UnitChannelInfo("player") 
		and VAS_SpellAvailable(32375)
		--and select(2,GetSpellCooldown(32375)) < 2 
		and IsUsableSpell(32375)
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then
			VAS_aoeCast(32375,nil)
			--if SpellIsTargeting() then CameraOrSelectOrMoveStart() CameraOrSelectOrMoveStop() end  
			--VAS_WriteToChat("\124cFFFF55FFRight Alt Key Down - Mass Dispel!")
			return true
		end
	end

	--SolaceInsanity 
	if select(3, Vasa_UnitInfo("player")) <= Vasa_SolaceInsanity
	and not stopdps
	and select(2,GetTalentRowSelectionInfo(3)) == 9 
	and select(2,GetSpellCooldown(129250)) < 2 
	and not UnitBuffID("player", 109964) then
		if UnitAffectingCombat("player")	
		--and VAS_SpellAvailable(129250) 	
		and UnitExists("target")	
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and not Vasa_Moving
		and IsSpellInRange(GetSpellInfo(14914),"target") == 1
		and UnitCanAttack("player", "target") 
		and not LineOfSight("target")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then		
			VAS_Cast(14914,"target") --129250 or 139139
			--VAS_WriteToChat("\124cFFFF55FFSolaceInsanity - HP: " ..members[1].HP) 
			return true 
		end
	end

	if Vasa_MindbenderCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and not UnitBuffID("player", 109964)
		and select(3, Vasa_UnitInfo("player")) < Vasa_Mindbender
		and VAS_SpellAvailable(34433) 
		and UnitExists("target")
		and not Vasa_Moving
		and IsSpellInRange(GetSpellInfo(34433),"target") == 1
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player")
		and UnitCanAttack("player", "target") then
			VAS_Cast(34433,"target")
			--VAS_WriteToChat("\124cFFFF55FFMBender")
			return true 
		end
	end

	--HymnOfHope (TC)
	if Vasa_MHymnOfHopeCheck then	
		if (VachiusaDiscPriest_HymnOfHope_key and not GetCurrentKeyBoardFocus()) then		
			if VAS_SpellAvailable(64901) 
			--and GetSpellCooldown(64901) == 0
			and not UnitBuffID("player", 109964) --Spirit Shell
			and UnitAffectingCombat("player")
			and not Vasa_Moving 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") 
			and not stopcasting then
				VAS_Cast(64901,nil)
				--VAS_WriteToChat("\124cFFFF55FFKey Down - HymnOfHope!")	
				return true 
			end
		end
	end

	if Vasa_HymnOfHopeCheck then
		if select(3, Vasa_UnitInfo("player")) < Vasa_HymnOfHope
		--and GetSpellCooldown(64901) == 0
		and not UnitBuffID("player", 109964) --Spirit Shell
		and UnitAffectingCombat("player")
		and VAS_SpellAvailable(64901)
		and not Vasa_Moving 
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") 
		and not stopcasting then				
			VAS_Cast(64901,nil)
			--VAS_WriteToChat("\124cFFFF55FFAuto - HymnOfHope!")	
			return true 
		end
	end

	if Vasa_UnitInfo("player") <= Vasa_DesperatePrayer 
	--and false --added
	and UnitAffectingCombat("player") then	
		if Vasa_DesperatePrayerCheck
		and VAS_SpellAvailable(19236) --Desperate Prayer
		--and GetSpellCooldown(19236) == 0
		and select(2,GetTalentRowSelectionInfo(4)) == 10 --check talent
		then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end		
			VAS_Cast(19236,nil)	
			VAS_WriteToChat("\124cFFFF55FFDesperate Prayer - HP: " ..Vasa_UnitInfo("player")) 
			return true
		elseif GetItemCount(5512,false,true) > 0	
		and VAS_SpellAvailable(5512) --Healthstone			
		and GetItemCooldown(5512) == 0 then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end		
			VAS_UseItemByName(5512)
			VAS_WriteToChat("\124cFFFF55FFHealthstone - HP: " ..Vasa_UnitInfo("player")) 
			return true
		--elseif GetInventoryItemCooldown(6)==0 --Grounded Plasma Shield 	
		--then 
			--VAS_UseInventoryItem(6) 
			--return true
		end
	end

	if Vasa_RacialsCheck
	and false --added
	and not UnitChannelInfo("player")
	and not UnitCastingInfo("player")
	and UnitAffectingCombat("player") then

		local PQ_Class = select(2, UnitClass("player")) 
		
		--Draenei 
		local GiftOfTheNaaru = 59542	
		--Blood Elf
		local ArcaneTorrent = 28730 --mana regen
		
		if PQ_Class == "PALADIN" then
			GiftOfTheNaaru = 59542	
		elseif PQ_Class == "MONK" then 
			GiftOfTheNaaru = 121093
			ArcaneTorrent = 129597 --chi regen
		elseif PQ_Class == "PRIEST" then  
			GiftOfTheNaaru = 59544
		elseif PQ_Class == "SHAMAN" then 
			GiftOfTheNaaru = 59547
		end

		--Troll 
		local Berserking = 26297 
		--Undead
		local WillOfTheForsaken = 7744  
		--Dwarven 
		local Stoneform = 20594 
		--Human 
		local EveryManForHimself = 59752
		--Undead 
		--local Cannibalize = 20577 --not much helpful
		--Orc 
		local BloodFury = 33702
		--Gloves Engineer
		local _, GECooldown, GEReady = GetInventoryItemCooldown("player", 10)
				
		--HP
		if IsSpellKnown(GiftOfTheNaaru) 
		--and GetSpellCooldown(GiftOfTheNaaru) == 0 
		and VAS_SpellAvailable(GiftOfTheNaaru)
		and Vasa_UnitInfo("player") <= 30	
		then		
			VAS_Cast(GiftOfTheNaaru,nil)	 
			return true 
		end
		
		--Mana
		if IsSpellKnown(ArcaneTorrent) 
		and PQ_Class ~= "MONK"
		--and GetSpellCooldown(ArcaneTorrent) == 0 
		and VAS_SpellAvailable(ArcaneTorrent)
		and select(3, Vasa_UnitInfo("player")) <= 80	
		then		
			VAS_Cast(ArcaneTorrent,nil)	 
			return true 
		end	
		
		--CDs
		if not racialcds then
			function racialcds()
				if IsSpellKnown(BloodFury) 
				--and GetSpellCooldown(BloodFury) == 0 
				and VAS_SpellAvailable(BloodFury)	
				then		
					VAS_Cast(BloodFury,nil)	 
					return true 
				elseif IsSpellKnown(Berserking) 
				--and GetSpellCooldown(Berserking) == 0 
				and VAS_SpellAvailable(Berserking)	
				then		
					VAS_Cast(Berserking,nil)	 
					return true 
				elseif GECooldown == 0 
				and GEReady == 1 then
					VAS_UseInventoryItem(10)
				end
			end
		end
		
		if lowhpmembers >=5 then
			racialcds()
		end
		
		--Removes any Charm, Fear and Sleep effect
		if not GotFear then
			function GotFear(t) 
				local debuff = { 10326, 8122, 2094, 5782, 5484, 6358, 5246 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end
		if IsSpellKnown(WillOfTheForsaken) 
		--and GetSpellCooldown(WillOfTheForsaken) == 0 
		and VAS_SpellAvailable(WillOfTheForsaken)	
		and GotFear("player")
		then		
			VAS_Cast(WillOfTheForsaken,nil)	 
			return true 
		end  
		
		--Removes all poison, disease and bleed effects and reduces all damage taken by 10% for 8 sec
		if not GotPoison then
			function GotPoison(t)
				local i, debuff = 1, select(5,UnitDebuff(t, 1)) 
				while debuff do
					if debuff == "Poison" or debuff == "Disease" then return true end
					i = i + 1 debuff = select(5,UnitDebuff(t, i)) 
				end
			end
		end	
		if IsSpellKnown(Stoneform) 
		--and GetSpellCooldown(Stoneform) == 0 
		and VAS_SpellAvailable(Stoneform)	
		and GotPoison("player")
		then		
			VAS_Cast(Stoneform,nil)	 
			return true 
		end    	
		
		--Removes all movement impairing effects and all effects which cause loss of control of your character
		if not LostControl then
			function LostControl(t) 
				local debuff = { 122, 10326, 8122, 2094, 5782, 5484, 6358, 5246, 408 }
				for i=1, #debuff do if UnitDebuffID(t,debuff[i]) then return true end end
			end
		end  
		if IsSpellKnown(EveryManForHimself) 
		--and GetSpellCooldown(EveryManForHimself) == 0 
		and VAS_SpellAvailable(EveryManForHimself)	
		and LostControl("player")
		then		
			VAS_Cast(EveryManForHimself,nil)	 
			return true 
		end		
	end

	if 100 * UnitPower("player") / UnitPowerMax("player") < 80
	and GetInventoryItemCooldown("player",14) == 0
	and not UnitCastingInfo("player") 
	and false
	then 
		VAS_UseInventoryItem(14)
		--VAS_WriteToChat("\124cFFFF55FFTrinket mana - HP: " ..members[1].HP) 
	end

	if Vasa_SpiritShellCheck then	
		if (VachiusaDiscPriest_SpiritShell_key and not GetCurrentKeyBoardFocus())
		 and UnitAffectingCombat("player")
		 --and select(2,GetSpellCooldown(109964)) < 2
		 and VAS_SpellAvailable(109964) 
		 then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end	 
			
			if VAS_SpellAvailable(89485)
			and not UnitBuffID("player", 89485)
			--and GetSpellCooldown(89485) == 0 
			and not UnitCastingInfo("player") then			
				--VAS_WriteToChat("\124cFFFF55FFInner Focus SpiritShell!")
				VAS_Cast(89485,nil)	 				
			end	
			 
			if GetInventoryItemCooldown("player", 10)==0 
			--and false
			and not UnitCastingInfo("player") then
				VAS_UseInventoryItem(10)
				--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
			end	 
					
			if VAS_SpellAvailable(10060)
			--and select(2,GetSpellCooldown(10060)) < 2 
			and select(2,GetTalentRowSelectionInfo(5)) == 14 
			and not UnitCastingInfo("player") then
				VAS_Cast(10060,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
			end	 		
					
			if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
			and VAS_SpellAvailable(81700) 
			and not UnitCastingInfo("player") then	 		
				VAS_Cast(81700,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFCast Archangel Cascade!")			
			end
			
			VAS_Cast(109964,nil)	 
			--VAS_WriteToChat("\124cFFFF55FFCast Spirit Shell!")	
			return true
		end
	end

	if VAS_SpellAvailable(596) 
	 and UnitBuffID("player", 109964)
	 and select(15, UnitBuffID("player", 109964)) < 2
	 and IsUsableSpell(596)
	 and not Vasa_Moving 
	 and not UnitChannelInfo("player")
	 and not UnitCastingInfo("player") 
	 and not stopcasting 
	 and not LLdebuff then
	 
		if GetInventoryItemCooldown("player", 10)==0 
		--and false
		then
			VAS_UseInventoryItem(10)
			--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
		end	 
			
		if VAS_SpellAvailable(10060)
		--and select(2,GetSpellCooldown(10060)) < 2 
		and select(2,GetTalentRowSelectionInfo(5)) == 14 
		then
			VAS_Cast(10060,nil)	 
			--VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
		end	 		
			
		if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
		and VAS_SpellAvailable(81700) 
		then	 		
			VAS_Cast(81700,nil)	 
			--VAS_WriteToChat("\124cFFFF55FFCast Archangel Cascade!")			
		end	

		PRGetDistanceTablebuff(100, 30, 0, 109964)	
		PRGetDistanceTablebyHPbuff(100,0)
		
		if #prdistancebyhpbuff > 1 then			
			for i=1,#prdistancebyhpbuff do
				if IsSpellInRange(GetSpellInfo(596),prdistancebyhpbuff[i].Unit) 
				and not UnitBuffID(prdistancebyhpbuff[i].Unit,109964,"player")
				and (prdistancebyhpbuff[i].PD >= 0) then
					if not UnitIsUnit(prdistancebyhpbuff[i].Unit, prdistancebyhpbuff[i+1].Unit) then		
						VAS_Cast(596,prdistancebyhpbuff[i].Unit)			
						--VAS_WriteToChat("\124cFFFF55FFPrayerOfHealing SSCombo Player Auto: " ..UnitName(prdistancebyhpbuff[i].Unit).." - HP: "..prdistancebyhpbuff[i].HP.." - PD: "..prdistancebyhpbuff[i].PD.." - U2: " ..UnitName(prdistancebyhpbuff[i+1].Unit).." - HP2: "..prdistancebyhpbuff[i+1].HP.." - PD2: "..prdistancebyhpbuff[i+1].PD) 						
						return true
					end
				end
			end			
		else	
			VAS_Cast(596,"player")	
			--VAS_WriteToChat("\124cFFFF55FFPrayerOfHealing SSCombo myself")	
			return true		
		end	
	end

	if Vasa_DPSOnlyCheck and DPSBurstMode then
		if UnitAffectingCombat("player")
		and not stopdps	 
		and UnitExists("target")
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and UnitCanAttack("player", "target") 
		and not LineOfSight("target")
		and not UnitCastingInfo("player") then
			local PeMoving = false
			if GlyphCheck(119866) then
				PeMoving = true
			else
				if not Vasa_Moving then
					PeMoving = true
				end
			end		
			local SWP,_,_,_,_,_,SWPtimer = UnitDebuffID("target",589,"PLAYER")			
			if VAS_SpellAvailable(14914) --Holy Fire 
			and IsSpellInRange(GetSpellInfo(14914),"target") == 1
			and ((GetSpellCooldown(129250) == 0	and select(2,GetTalentRowSelectionInfo(3)) == 9) or (GetSpellCooldown(14914) == 0 and select(2,GetTalentRowSelectionInfo(3)) ~= 9))
			and IsUsableSpell(14914)
			then	
				--VAS_WriteToChat("\124cFFFF55FFHoly Fire!")
				VAS_Cast(14914,"target")	 
				return true
			elseif VAS_SpellAvailable(32379) --SW:D		
			and IsSpellInRange(GetSpellInfo(32379),"target") == 1
			--and select(2,GetSpellCooldown(32379)) < 2
			and IsUsableSpell(32379)
			then	
				VAS_WriteToChat("\124cFFFF55FFSW:D!")
				VAS_Cast(32379,"target")	 
				return true			
			elseif VAS_SpellAvailable(589) --SW:P		
			and SWP == nil 
			and IsSpellInRange(GetSpellInfo(589),"target") == 1
			--and select(2,GetSpellCooldown(589)) < 2
			and IsUsableSpell(589)
			then			
				VAS_WriteToChat("\124cFFFF55FFSW:P!")
				VAS_Cast(589,"target")	 
				return true 
			elseif VAS_SpellAvailable(47540) --Penance
			and PeMoving
			and IsSpellInRange(GetSpellInfo(47540),"target") == 1
			--and select(2,GetSpellCooldown(47540)) < 2
			and IsUsableSpell(47540)
			then	
				VAS_WriteToChat("\124cFFFF55FFPenance!")
				VAS_Cast(47540,"target")	 
				return true						 
			elseif VAS_SpellAvailable(585) --Smite		
			and not Vasa_Moving
			and IsSpellInRange(GetSpellInfo(585),"target") == 1
			--and select(2,GetSpellCooldown(585)) < 2
			and IsUsableSpell(585)
			then	
				VAS_WriteToChat("\124cFFFF55FFSmite!")
				VAS_Cast(585,"target")	 
				return true 
			else
				VAS_WriteToChat("\124cFFFF55FFDebug DPS 1 - HP: " ..members[1].HP) 
				return true 
			end
		end
	end

	--TsulongHeal 
	if Vasa_53EventsCheck then	
		local bossCheck = "boss1" 
		local tsulongboss = false
		if UnitExists(bossCheck) then 
			local npcID = tonumber(UnitGUID(bossCheck):sub(6,10), 16) 	        
			if npcID == 62442 
			and UnitAffectingCombat("player") then --Tsulong	
				--VAS_WriteToChat("\124cFFFF55FFDebug NPCID: " ..npcID) 
				tsulongboss = true
			end
		end	
		
		if tsulongboss
		and VAS_SpellAvailable(2060)  	
		and IsUsableSpell(2060) 
		and IsSpellInRange(GetSpellInfo(2060),"boss1") == 1
		and not Vasa_Moving then
			if Vasa_UnitInfo("boss1") < 99 then
				if GetInventoryItemCooldown("player", 10)==0 
				--and false
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then
					VAS_UseInventoryItem(10)
					----VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
				end	 
					
				if VAS_SpellAvailable(10060)
				--and select(2,GetSpellCooldown(10060)) < 2 
				and select(2,GetTalentRowSelectionInfo(5)) == 14 
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then
					VAS_Cast(10060,nil)	 
					----VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
				end	 		
					
				if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
				and VAS_SpellAvailable(81700) 
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then	 		
					VAS_Cast(81700,nil)	 
					--VAS_WriteToChat("\124cFFFF55FFCast Archangel Cascade!")			
				end	 	
			
				if VAS_SpellAvailable(139) 
				and IsUsableSpell(139) 	 		 	
				and not UnitBuffID("boss1", 139, "PLAYER") 
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then	 		
					VAS_Cast(139,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Renew Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 					 			 	
				end
			
				if VAS_SpellAvailable(2061) 		 
				 and IsUsableSpell(2061) 
				 and not UnitBuffID("player", 89485) --Inner Focus
				 and (select(3, Vasa_UnitInfo("player")) > 70 or UnitDebuff("player","Bathed in Light") or UnitDebuff("player","Омовение светом") or UnitDebuff("player","In Licht gebadet")) --Bathed in Light buff		
				 and not UnitChannelInfo("player")
				 and not UnitCastingInfo("player") then
					VAS_Cast(2061,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast FlashHeal Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 
					return true
				end
		
				if VAS_SpellAvailable(47540)  
				 and IsUsableSpell(47540) 
				 and not UnitChannelInfo("player")
				 and not UnitCastingInfo("player") then				
					VAS_Cast(47540,"boss1")	 
					--VAS_WriteToChat("\124cFFFF55FFCast Penance Tsulong - HP: " ..Vasa_UnitInfo("boss1")) 	
				end
				
				if members[1].HP > 30 --Prevent raid wipe
				and lowhpmembers < 10 
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then 					
					VAS_Cast(2060,"boss1")	 			
					--VAS_WriteToChat("\124cFFFF55FFCast GreaterHeal Tsulong - HP: " ..Vasa_UnitInfo("boss1"))	 		
					return true
				end		
		
			end
		end
		
	end

	if not UnitAffectingCombat("player") 
	and UnitIsConnected("mouseover")
	and UnitCanCooperate("player","mouseover") 			
	and UnitIsDeadOrGhost("mouseover") 
	and not UnitHasIncomingResurrection("mouseover") 
	then		
		if VAS_SpellAvailable(83968) 		
		and not UnitDebuff("mouseover", GetSpellInfo(95223)) ----Mass Resurrection debuff
		and Vasa_CheckLastCast(83968, 2.0)		
		then
			if IsInRaid() then
					group = "raid"
			elseif IsInGroup() then
					group = "party"
			end
			local deadnum = 0
			if group then
				for i = 1, GetNumGroupMembers() do 
					local member = group..i
					if UnitIsDeadOrGhost(member) then
						if not UnitDebuff(member, GetSpellInfo(95223)) then ----Mass Resurrection debuff 
							deadnum = deadnum + 1
						end
					end
				end
			end		
			if deadnum >= 2 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then
				VAS_Cast(83968,nil) --Mass Resurrection	 
				--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto MasRes!")
				return true		
			end
		end
		
		if VAS_SpellAvailable(2006)
		and IsUsableSpell(2006) 		
		and Vasa_CheckLastCast(2006, 2.0)	
		and (IsSpellInRange(GetSpellInfo(2006),"mouseover") == 1) 		
		and not VAS_IsOutOfSight("mouseover") 
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then 
			VAS_Cast(2006,"mouseover") --Resurrection	 
			--VAS_WriteToChat("\124cFFFF55FFMouseover - Auto Res!")
			return true			
		end	
	end

	if UnitAffectingCombat("player")
	and not stopdps
	and VAS_SpellAvailable(14914) 
	and UnitExists("target")
	and IsSpellInRange(GetSpellInfo(14914),"target") == 1
	--and GetSpellCooldown(14914) == 0
	and IsUsableSpell(14914)
	and not (select(2,GetTalentRowSelectionInfo(3)) == 9) --check talent
	and not VAS_IsOutOfSight("target")
	and not UnitIsDeadOrGhost("target")
	and UnitCanAttack("player", "target") 
	and not LineOfSight("target")
	and not UnitChannelInfo("player")
	and not UnitCastingInfo("player") then
		VAS_Cast(14914,"target")
		--VAS_WriteToChat("\124cFFFF55FFHoly Fire - HP: " ..members[1].HP) 
		return true 
	end

	--PenanceDmg
	if Vasa_DPSCheck then
		local PeMoving = false
		if GlyphCheck(119866) then
			PeMoving = true
		else
			if not Vasa_Moving then
				PeMoving = true
			end
		end
		
		if UnitAffectingCombat("player")
		and not stopdps
		and VAS_SpellAvailable(47540) 
		and UnitExists("target")
		and PeMoving
		and IsSpellInRange(GetSpellInfo(47540),"target") == 1
		--and GetSpellCooldown(47540) == 0
		and IsUsableSpell(47540)
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and UnitCanAttack("player", "target") 
		and not LineOfSight("target")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") 
		and not stopcasting then
			if Vasa_PenanceCheck then
				if members[1].HP > Vasa_Penance then
				VAS_Cast(47540,"target")
				--VAS_WriteToChat("\124cFFFF55FFPenancedmg1 - HP: " ..members[1].HP) 
					return true 
				end
			else
				VAS_Cast(47540,"target")
				--VAS_WriteToChat("\124cFFFF55FFPenancedmg2 - HP: " ..members[1].HP) 
				return true 
			end
		end
	end

	if Vasa_DPSCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and VAS_SpellAvailable(589) 
		and UnitExists("target")
		and IsSpellInRange(GetSpellInfo(589),"target") == 1
		and IsUsableSpell(589)
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and Vasa_UnitInfo("target") > 10
		and select(3, Vasa_UnitInfo("player")) > 80 
		and not LineOfSight("target")
		and UnitCanAttack("player", "target") then
			local SWP,_,_,_,_,_,SWPtimer = UnitDebuffID("target",589,"PLAYER")
			if SWP == nil 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then
				VAS_Cast(589,"target")
				--VAS_WriteToChat("\124cFFFF55FFSWP - HP: " ..members[1].HP) 
				return true 
			end
		end
	end

	if Vasa_CascadeCheck then
		if VAS_SpellAvailable(121135)
		 and UnitAffectingCombat("player")
		 and select(3, Vasa_UnitInfo("player")) > 15
		 --and select(2,GetSpellCooldown(121135)) < 2
		 and IsUsableSpell(121135) 
		 and select(2,GetTalentRowSelectionInfo(6)) == 16 --check talent
		 and AverageHealth(Vasa_CascadeLimit) <= Vasa_Cascade --total of 15 players/enemies can be hit
		 and not UnitChannelInfo("player")	
		 and not UnitCastingInfo("player") then
			if GetInventoryItemCooldown("player", 10)==0 
			--and false
			then
				VAS_UseInventoryItem(10)
				--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
			end	 
				
			if VAS_SpellAvailable(10060)
			--and select(2,GetSpellCooldown(10060)) < 2 
			and select(2,GetTalentRowSelectionInfo(5)) == 14 
			then
				VAS_Cast(10060,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
			end	 		
				
			if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
			and VAS_SpellAvailable(81700) 
			then
				VAS_Cast(81700,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFCast Archangel Cascade!")			
			end
				
			VAS_Cast(121135,members[1].Unit)
			--VAS_WriteToChat("\124cFFFF55FFCascade Combo Auto!")	
			return true		
		end
	end

	if Vasa_HaloCheck then
		if VAS_SpellAvailable(120517)
		 and not stopdps
		 and UnitAffectingCombat("player")
		 and select(3, Vasa_UnitInfo("player")) > 15
		 --and select(2,GetSpellCooldown(120517)) < 2
		 and IsUsableSpell(120517) 
		 and select(2,GetTalentRowSelectionInfo(6)) == 18 --check talent
		 and AverageHealth(Vasa_HaloLimit) <= Vasa_Halo --total of 15 players/enemies can be hit
		 and not UnitChannelInfo("player")	
		 and not UnitCastingInfo("player") then
			if GetInventoryItemCooldown("player", 10)==0 
			--and false
			then
				VAS_UseInventoryItem(10)
				--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
			end	 
				
			if VAS_SpellAvailable(10060)
			--and select(2,GetSpellCooldown(10060)) < 2 
			and select(2,GetTalentRowSelectionInfo(5)) == 14 
			then
				VAS_Cast(10060,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
			end	 		
				
			if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
			and VAS_SpellAvailable(81700) 
			then	 		
				VAS_Cast(81700,nil)	 
				--VAS_WriteToChat("\124cFFFF55FFCast Archangel Halo!")			
			end
				
			--VAS_WriteToChat("\124cFFFF55FFHalo Combo Auto!")	
			VAS_Cast(120517,"player")
			return true		
		end
	end

	if Vasa_PrayerOfHealingCheck then
		if VAS_SpellAvailable(596) 
		 and select(3, Vasa_UnitInfo("player")) > 15 
		 and IsUsableSpell(596)
		 and AverageHealth(Vasa_PrayerOfHealingLimit) <= Vasa_PrayerOfHealing
		 and not Vasa_Moving 
		 and not stopcasting 
		 and not LLdebuff then
		
			PRGetDistanceTable((Vasa_PrayerOfHealing+5), 30, 3)	
			PRGetDistanceTablebyHP(Vasa_PrayerOfHealing,3)
								
			if IsSpellInRange(GetSpellInfo(596),prdistancebyhp[1].Unit) 
			and prdistancebyhp[1].PD >= 3
			and prdistancebyhp[1].HP <= Vasa_PrayerOfHealing 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then				
				if GetInventoryItemCooldown("player", 10)==0 
				--and false
				and (prdistancebyhp[1].HP <= (Vasa_PrayerOfHealing-10)) 
				then			
					VAS_UseInventoryItem(10)
					--VAS_WriteToChat("\124cFFFF55FFGloves Engineer buff!")			
				end	 
					
				if VAS_SpellAvailable(10060)
				--and select(2,GetSpellCooldown(10060)) < 2 
				and select(2,GetTalentRowSelectionInfo(5)) == 14
				and (prdistancebyhp[1].HP <= (Vasa_PrayerOfHealing-10)) 
				then	 		
					VAS_Cast(10060,nil)	 
					--VAS_WriteToChat("\124cFFFF55FFPower Infusion!")
				end	 		
					
				if UnitBuffID("player", 81661) and select(4, UnitBuffID("player", 81661)) >= 5 
				and VAS_SpellAvailable(81700) 
				and (prdistancebyhp[1].HP <= (Vasa_PrayerOfHealing-10)) 
				then	 		
					VAS_Cast(81700,nil)	 
					--VAS_WriteToChat("\124cFFFF55FFCast Archangel Cascade!")			
				end
							
				if VAS_SpellAvailable(89485)
				and not UnitBuffID("player", 89485)
				--and GetSpellCooldown(89485) == 0 
				and prdistancebyhp[1].HP <= 30 
				then				 
					--VAS_WriteToChat("\124cFFFF55FFInner Focus Cascade!")
					VAS_Cast(89485,nil)	 				
				end		 			 				
				
				VAS_Cast(596,prdistancebyhp[1].Unit)
				--VAS_WriteToChat("\124cFFFF55FFCast PoH - Name: " ..UnitName(prdistancebyhp[1].Unit).." - HP: "..prdistancebyhp[1].HP.." - PD: "..prdistancebyhp[1].PD) 				
				return true
			end
		end
	end

	if Vasa_PrayerOfMendingCheck then
		if VAS_SpellAvailable(33076)
		and members[1].HP <= Vasa_PrayerOfMending 
		and UnitAffectingCombat("player")
		and IsUsableSpell(33076)	
		--and select(2,GetSpellCooldown(33076)) < 2
		and IsSpellInRange(GetSpellInfo(33076),members[1].Unit) == 1
		then	
			local PoM = false
			
			for i=1, #members do				
				if UnitBuffID(members[i].Unit, 41635) then
					PoM = true
					break
				end
			end	
			if PoM == false 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then
			--VAS_CustomTarget = members[1].Unit	
			VAS_Cast(33076,members[1].Unit)
			--VAS_WriteToChat("\124cFFFF55FFPoM - HP: " ..members[1].HP) 
			return true
		    end
		end
	end

	if Vasa_PowerWordShieldTankCheck then
		if VAS_SpellAvailable(17) 
		and IsUsableSpell(17) 
		then
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) 			 
					 and not UnitDebuffID(Vasa_Tanks[i].Unit, 6788)
					 and not UnitBuffID(Vasa_Tanks[i].Unit, 17)
					 and IsSpellInRange(GetSpellInfo(17),Vasa_Tanks[i].Unit) == 1 
					 and not UnitChannelInfo("player")
					 and not UnitCastingInfo("player") then
						--VAS_CustomTarget = Vasa_Tanks[i].Unit
						VAS_Cast(17,Vasa_Tanks[i].Unit)
						--VAS_WriteToChat("\124cFFFF55FFShield tank!")	
						return true
					end
				end
			end
			
			if UnitThreatSituation(members[1].Unit)	== 3
			 and not UnitDebuffID(members[1].Unit, 6788)
			 and not UnitBuffID(members[1].Unit, 17)
			 and members[1].HP < Vasa_PowerWordShield 
			 and IsSpellInRange(GetSpellInfo(17),members[1].Unit) == 1 
			 and not UnitChannelInfo("player")
			 and not UnitCastingInfo("player") then
				--VAS_CustomTarget = members[1].Unit
				VAS_Cast(17,members[1].Unit)
				--VAS_WriteToChat("\124cFFFF55FFShield high threat member!")	
				return true
			end
		end
	end

	if Vasa_RenewTankCheck then
		if VAS_SpellAvailable(139) 
		and IsUsableSpell(139)
		then
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit)
					 and select(3, Vasa_UnitInfo("player")) > 15
					 and Vasa_Tanks[i].HP < Vasa_RenewTank
					 and IsSpellInRange(GetSpellInfo(139),Vasa_Tanks[i].Unit) == 1 
					 and not UnitChannelInfo("player")
					 and not UnitCastingInfo("player") then
						if UnitBuffID(Vasa_Tanks[i].Unit, 139) then
							if (select(7, UnitBuffID(Vasa_Tanks[i].Unit, 139)) - GetTime() <= 2) 
							then
								--VAS_CustomTarget = Vasa_Tanks[i].Unit
								VAS_Cast(139,Vasa_Tanks[i].Unit)
								--VAS_WriteToChat("\124cFFFF55FFRenew soon expired on tank!")	
								return true
							end
						else
							--VAS_CustomTarget = Vasa_Tanks[i].Unit
							VAS_Cast(139,Vasa_Tanks[i].Unit)
							--VAS_WriteToChat("\124cFFFF55FFRenew tank!")	
							return true
						end				
					end
				end
			end
			
			if UnitThreatSituation(members[1].Unit)	== 3
			 and select(3, Vasa_UnitInfo("player")) > 20
			 and not UnitBuffID(members[1].Unit, 139)
			 and members[1].HP < Vasa_Renew 
			 and IsSpellInRange(GetSpellInfo(139),members[1].Unit) == 1 
			 and not UnitChannelInfo("player")
			 and not UnitCastingInfo("player") then
				--VAS_CustomTarget = members[1].Unit
				VAS_Cast(139,members[1].Unit)
				--VAS_WriteToChat("\124cFFFF55FFRenew high threat member!")	
				return true
			end
		end
	end

	if Vasa_PowerWordShieldMovingCheck then
		if VAS_SpellAvailable(17) 
		and select(2,GetTalentRowSelectionInfo(2)) == 4 --Body and Soul
		and Vasa_Moving
		and not UnitDebuffID("player", 6788)
		and not UnitBuffID("player", 17)	
		and IsUsableSpell(17) 
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then	  
			VAS_Cast(17,"player")
			--VAS_WriteToChat("\124cFFFF55FFPowerWordFortitudeMoving - HP: " ..members[1].HP) 
			return true
		end
	end

	if Vasa_TankFlaskHealCheck then
		if VAS_SpellAvailable(2061) 
		 and UnitAffectingCombat("player")	 
		 and IsUsableSpell(2061)
		 and not Vasa_Moving 
		 and not UnitChannelInfo("player")
		 and not UnitCastingInfo("player")	 
		 and not stopcasting then	 
			if #Vasa_Tanks > 0 then
				for i=1, #Vasa_Tanks do
					if UnitThreatSituation(Vasa_Tanks[i].Unit) 	
					 and Vasa_Tanks[i].HP <= Vasa_TankFlaskHeal 
					 and select(3, Vasa_UnitInfo("player")) > 10 		 
					 and IsSpellInRange(GetSpellInfo(2061),Vasa_Tanks[i].Unit) == 1 then
						if VAS_SpellAvailable(89485)
						and not UnitBuffID("player", 89485)
						--and GetSpellCooldown(89485) == 0 
						then				
							VAS_WriteToChat("\124cFFFF55FFInner Focus TankFlaskHeal!")
							VAS_Cast(89485,nil)
						end					 
						--VAS_CustomTarget = Vasa_Tanks[i].Unit
						VAS_Cast(2061,Vasa_Tanks[i].Unit)
						VAS_WriteToChat("\124cFFFF55FFTank Flask Heal!")	
						return true					
					end
				end
			end
		end
	end

	if Vasa_FadeCheck then	
		if UnitThreatSituation("player") == 3
		and VAS_SpellAvailable(586) 
		and not stopfade then
			if UnitCastingInfo("player") then
				VAS_SpellStopCasting()
			end	
			VAS_Cast(586,nil)
			--VAS_WriteToChat("\124cFFFF55FFFade!")
			return true
		end
	end

	if Vasa_BindingHealCheck then
		if VAS_SpellAvailable(32546)
		and members[1].HP < Vasa_BindingHeal
		and Vasa_UnitInfo("player") < Vasa_SelfBindingHeal
		and not Vasa_Moving 
		and IsSpellInRange(GetSpellInfo(32546),members[1].Unit) == 1
		and IsUsableSpell(32546)
		and not UnitIsUnit(members[1].Unit,"player")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") 
		and not stopcasting then
			--VAS_CustomTarget = members[1].Unit
			--VAS_WriteToChat("\124cFFFF55FFPBinding - HP: " ..members[1].HP) 
			VAS_Cast(32546,members[1].Unit)
			return true
		end
	end

	if Vasa_PowerWordShieldCheck then
		if VAS_SpellAvailable(17) 
		and members[1].HP < Vasa_PowerWordShield
		and not UnitDebuffID(members[1].Unit, 6788)
		and not UnitBuffID(members[1].Unit, 17)
		and IsSpellInRange(GetSpellInfo(17),members[1].Unit) == 1
		and IsUsableSpell(17) 
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then
			--VAS_CustomTarget = members[1].Unit
			VAS_Cast(17,members[1].Unit)
			--VAS_WriteToChat("\124cFFFF55FFPWS - HP: " ..members[1].HP) 
			return true
		end
	end

	if Vasa_FlashHealCheck then
		if VAS_SpellAvailable(2061) 
		 and IsSpellInRange(GetSpellInfo(2061),members[1].Unit) == 1
		 and IsUsableSpell(2061)
		 and not Vasa_Moving 
		 and not stopcasting then
			if UnitBuffID("player", 114255) then --Surge of Light buff - From Darkness, Comes Light
				if (select(7, UnitBuffID("player", 114255)) - GetTime()) <= 3 
				or select(4, UnitBuffID("player", 114255)) >= 2 then 
					local Vasa_FlashHeal = Vasa_FlashHeal + 10
				end
			end	 	 
			if members[1].HP < Vasa_FlashHeal and select(3, Vasa_UnitInfo("player")) > 10 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then	
				if VAS_SpellAvailable(89485)
				and not UnitBuffID("player", 89485)
				--and GetSpellCooldown(89485) == 0 
				then				
					VAS_WriteToChat("\124cFFFF55FFInner Focus FlashHeal!")
					VAS_Cast(89485,nil)	 				
				end	
				--VAS_CustomTarget = members[1].Unit
				--VAS_WriteToChat("\124cFFFF55FFFlash - HP: " ..members[1].HP) 
				VAS_Cast(2061,members[1].Unit)
				return true
			end
		end
	end

	if Vasa_GreaterHealCheck then
		if VAS_SpellAvailable(2060) 
		 and IsSpellInRange(GetSpellInfo(2060),members[1].Unit) == 1
		 and IsUsableSpell(2060) 
		 and not Vasa_Moving 
		 and not stopcasting then
			if members[1].HP < Vasa_GreaterHealing 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then	
				if VAS_SpellAvailable(89485)
				and not UnitBuffID("player", 89485)
				--and GetSpellCooldown(89485) == 0 
				then				
					VAS_WriteToChat("\124cFFFF55FFInner Focus GreaterHeal!")
					VAS_Cast(89485,nil)	 
				end			
				--VAS_CustomTarget = members[1].Unit
				VAS_WriteToChat("\124cFFFF55FFGreaterHeal - HP: " ..members[1].HP) 
				VAS_Cast(2060,members[1].Unit)
				return true
			end
		end
	end

	--Penance
	if Vasa_PenanceCheck or not Vasa_DPSCheck then
		local PeMoving = false
		if GlyphCheck(119866) then
			PeMoving = true
		else
			if not Vasa_Moving then
				PeMoving = true
			end
		end

		if VAS_SpellAvailable(47540) 
		 and members[1].HP <= Vasa_Penance 
		 --and GetSpellCooldown(47540) == 0
		 and IsUsableSpell(47540) 
		 and PeMoving
		 and (not UnitBuffID(members[1].Unit, 77613) --Grace buff
		 or UnitDebuffID(members[1].Unit, 6788)) -- Weakened Soul debuff
		 and IsSpellInRange(GetSpellInfo(47540),members[1].Unit) == 1 
		 and not UnitChannelInfo("player")
		 and not UnitCastingInfo("player") 
		 and not stopcasting then				
			--VAS_CustomTarget = members[1].Unit	
			--VAS_WriteToChat("\124cFFFF55FFPenance - HP: " ..members[1].HP) 
			VAS_Cast(47540,members[1].Unit)
			return true
		end
	end

	if Vasa_RenewCheck then
		if VAS_SpellAvailable(139) 
		 and not UnitBuffID(members[1].Unit, 139)
		 and IsSpellInRange(GetSpellInfo(139),members[1].Unit) == 1
		 and IsUsableSpell(139)
		 and select(3, Vasa_UnitInfo("player")) >= 50 
		 and Vasa_Moving then
			if members[1].HP < Vasa_Renew 
			and not UnitChannelInfo("player")
			and not UnitCastingInfo("player") then
				--VAS_CustomTarget = members[1].Unit
				--VAS_WriteToChat("\124cFFFF55FFRenew - HP: " ..members[1].HP) 
				VAS_Cast(139,members[1].Unit)
				return true
			end
		end
	end

	if Vasa_DPSCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and VAS_SpellAvailable(585)
		and not Vasa_Moving
		and UnitExists("target")
		and IsUsableSpell(585)
		and GetSpellCooldown(47540) > 0 --Penance
		and not VAS_SpellAvailable(47540)	
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and IsSpellInRange(GetSpellInfo(585),"target") == 1
		and not LineOfSight("target")
		and UnitCanAttack("player", "target") 
		and not stopcasting then
			if members[1].HP >= 70 then
				if UnitBuffID("player", 81661) then
					if (select(4, UnitBuffID("player", 81661)) <= 4) 
					and not UnitChannelInfo("player")
					and not UnitCastingInfo("player") then
						VAS_Cast(585,"target")
						--VAS_WriteToChat("\124cFFFF55FFSmite1 - HP: " ..members[1].HP) 
						return true
					elseif (select(7, UnitBuffID("player", 81661)) - GetTime() < 3) 
					and not UnitChannelInfo("player")
					and not UnitCastingInfo("player") then
						VAS_Cast(585,"target")
						VAS_WriteToChat("\124cFFFF55FFSmite2 - HP: " ..members[1].HP) 
						return true
					end
				elseif not UnitBuffID("player", 81661) 
				and not UnitChannelInfo("player")
				and not UnitCastingInfo("player") then
					VAS_Cast(585,"target")
					--VAS_WriteToChat("\124cFFFF55FFSmite3 - HP: " ..members[1].HP) 
					return true
				end
			end
		end
	end

	if Vasa_HealCheck then
		if UnitIsDeadOrGhost("target") 
		or not UnitExists("target") 
		or (UnitExists("target")
		and not UnitCanAttack("player", "target"))
		then
			local Vasa_Heal = 95
		end
		
		if VAS_SpellAvailable(2050) 
		 and members[1].HP < Vasa_Heal 	 
		 and lowhpmembers < 3
		 and IsUsableSpell(2050) 
		 and not Vasa_Moving 
		 and (not UnitBuffID(members[1].Unit, 77613) --Grace buff
		 or UnitDebuffID(members[1].Unit, 6788)) -- Weakened Soul debuff
		 and IsSpellInRange(GetSpellInfo(2050),members[1].Unit) == 1 
		 and not UnitChannelInfo("player")
		 and not UnitCastingInfo("player") 
		 and not stopcasting then				
			--VAS_CustomTarget = members[1].Unit	
			VAS_Cast(2050,members[1].Unit)
			VAS_WriteToChat("\124cFFFF55FFCasting Heal - HP: " ..members[1].HP) 
			return true
		end
	end

	if Vasa_DPSCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and members[1].HP > Vasa_DPS
		and VAS_SpellAvailable(585) 
		and UnitExists("target")
		and IsUsableSpell(585)
		and GetSpellCooldown(47540) > 0 --Penance
		and not VAS_SpellAvailable(47540)
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and not Vasa_Moving
		and IsSpellInRange(GetSpellInfo(585),"target") == 1
		and UnitCanAttack("player", "target") 
		and not LineOfSight("target")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") 
		and not stopcasting then
			VAS_Cast(585,"target")
			--VAS_WriteToChat("\124cFFFF55FFSmite4 - HP: " ..members[1].HP) 
			--VAS_RunMacroText("/run VAS_Cast(585)),'target')")
			return true 
		end
	end		

	if Vasa_DPSCheck then
		if UnitAffectingCombat("player")
		and not stopdps
		and VAS_SpellAvailable(32379) 
		and UnitExists("target")
		and IsSpellInRange(GetSpellInfo(32379),"target") == 1
		and IsUsableSpell(32379)
		--and select(2,GetSpellCooldown(32379)) < 2
		and not VAS_IsOutOfSight("target")
		and not UnitIsDeadOrGhost("target")
		and Vasa_UnitInfo("target") <= 20
		and select(3, Vasa_UnitInfo("player")) > 70 
		and UnitCanAttack("player", "target") 
		and not LineOfSight("target")
		and not UnitChannelInfo("player")
		and not UnitCastingInfo("player") then
			--VAS_WriteToChat("\124cFFFF55FFSWD - HP: " ..members[1].HP) 
			VAS_Cast(32379,"target")
			return true 
		end
	end
	
	if PQI_VachiusaGeneral_RotationEngine_value == 4 then
		raidfu = nil
		vicon = nil
		CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", VAS_UpdateIcon)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 7 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		HealBot_OnEvent_VachiusaUpdate(vicon,raidfu)
	elseif PQI_VachiusaGeneral_RotationEngine_value == 8 and not UnitCastingInfo("player") then
		raidfu = nil
		vicon = nil
		ElvUF_OnEvent_VachiusaUpdate(vicon,raidfu)	
	end
	return true
end